import { HTTP } from "../utils/http.js";

export class Shop extends HTTP{

    getSearch(keyword) {
        return this.request({
            url: 'wxapp/search',
            data: { keyword }
        })
    }

    getShopIndex(page ,cate_id) {
        return this.request({
            url: 'goods/index',
            data: {
                page, cate_id
            }
        })
    }

    getShopDetail(id) {
        return this.request({
            url: 'goods/detail',
            data: {
                id
            }
        })
    }
    getPoster(id) {
        return this.request({
            url: 'goods/poster',
            data: {
                id
            }
        })
    }
    getOrderID(id) {
        return this.request({
            url: 'goods/order',
            method: 'POST',
            data: { id }
        })
    }

    getShops(keyword='') {
        return this.request({
            url: 'shops/index',
            data: {
                keyword
            }
        })
    }
    getShopDetails(id) {
        return this.request({
            url: 'shops/detail',
            data: { id }
        })
    }
    
   
}